home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Make / source / configure.bat < prev    next >
Encoding:
DOS Batch File  |  1997-08-27  |  1.2 KB  |  45 lines

  1. @echo off
  2. echo Configuring MAKE for DJGPP
  3.  
  4. rem The SmallEnv trick protects against too small environment block,
  5. rem in which case the values will be truncated and the whole thing
  6. rem goes awry.  COMMAND.COM will say "Out of environment space", but
  7. rem many people don't care, so we force them to care by refusing to go.
  8.  
  9. rem Where is the srcdir?
  10. set XSRC=.
  11. if not "%XSRC%"=="." goto SmallEnv
  12. if "%1%"=="" goto SrcDone
  13. set XSRC=%1
  14. if not "%XSRC%"=="%1" goto SmallEnv
  15.  
  16. :SrcDone
  17.  
  18. update %XSRC%/configh.dos ./config.h
  19.  
  20. rem Do they have Make?
  21. redir -o junk.$$$ -eo make -n -f NUL
  22. rem REDIR will return 1 if it cannot run Make.
  23. rem If it can run Make, it will usually return 2,
  24. rem but 0 is also OK with us.
  25. if errorlevel 2 goto MakeOk
  26. if not errorlevel 1 goto MakeOk
  27. if exist junk.$$$ del junk.$$$
  28. echo No Make program found--use DOSBUILD.BAT to build Make.
  29. goto End
  30.  
  31. rem They do have Make.    Generate the Makefile.
  32.  
  33. :MakeOk
  34. del junk.$$$
  35. update %XSRC%/Makefile.DOS ./Makefile
  36. echo Done.
  37. if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
  38. goto End
  39.  
  40. :SmallEnv
  41. echo Your environment is too small.  Please enlarge it and run me again.
  42.  
  43. :End
  44. set XRSC=
  45.